{include file="public/head"}
<body>
<div id="wrapper">
    {include file="public/menu"}

    <div id="page-wrapper" class="gray-bg dashbard-1">

        {include file="public/nav"}

        <div class="wrapper wrapper-content">
          <ul class="nav_list">
              <li class="active">
                  基本设置
              </li>
<!--              <li>-->
<!--                  微信设置-->
<!--              </li>-->
              <li>
                  收款信息
              </li>
              <li>
                  其他设置
              </li>
              <!--<li>-->
              <!--    奖金设置-->
              <!--</li>-->
          </ul>
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form class="form-horizontal m-t" id="commentForm">
                                <div class="detail">
                                    <section>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">网站名称：</label>
                                            <div class="col-sm-8">
                                                <input id="web_name" name="web_name" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.web_name}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">网站开关：</label>
                                            <div class="col-sm-8">
                                                <select id="web_switch" name="web_switch" class="form-control">
                                                    <option value="1" {if condition="$Config.web_switch eq 1"}selected{/if}>开启</option>
                                                    <option value="0" {if condition="$Config.web_switch eq 0"}selected{/if}>关闭</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">关闭提示：</label>
                                            <div class="col-sm-8">
                                                <input id="web_prompt" name="web_prompt" maxlength="1000" type="text" class="form-control" required="" aria-required="true" value="{$Config.web_prompt}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">积分专区每月限购：</label>
                                            <div class="col-sm-8">
                                                <input id="xiangou" name="xiangou" maxlength="1000" type="text" class="form-control" required="" aria-required="true" value="{$Config.xiangou}">
                                            </div>
                                        </div>
                                        <!--<div class="form-group">-->
                                        <!--    <label class="col-sm-3 control-label">提示手机号：</label>-->
                                        <!--    <div class="col-sm-8">-->
                                        <!--        <input id="phone" name="phone" maxlength="1000" type="text" class="form-control" required="" aria-required="true" value="{$Config.phone}">-->
                                        <!--    </div>-->
                                        <!--</div>-->
                                    </section>
<!--                                    <section class="hide">-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">AppID：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="wechat_appid" name="wechat_appid" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.wechat_appid}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">AppSecret：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="wechat_appsecret" name="wechat_appsecret" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.wechat_appsecret}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </section>-->
                                    <section class="hide">
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">客服姓名：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="service_name" name="service_name" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.service_name}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">客服电话：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="service_phone" name="service_phone" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.service_phone}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">客服微信：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="service_wechat" name="service_wechat" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.service_wechat}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">客服QQ：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="service_qq" name="service_qq" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.service_qq}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">客服邮箱：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="service_email" name="service_email" maxlength="255" type="email" class="form-control" required="" aria-required="true" value="{$Config.service_email}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">收款账户：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="web_ccounts_1" name="web_ccounts_1" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.web_ccounts_1}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">收款账户：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="web_ccounts_2" name="web_ccounts_2" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.web_ccounts_2}">-->
<!--                                            </div>-->
<!--                                        </div>-->
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">银行名称：</label>
                                            <div class="col-sm-8">
                                                <input id="bank_name" name="bank_name" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.bank_name}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">银行卡号：</label>
                                            <div class="col-sm-8">
                                                <input id="bank_num" name="bank_num" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.bank_num}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">开户姓名：</label>
                                            <div class="col-sm-8">
                                                <input id="bank_user" name="bank_user" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.bank_user}">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">微信收款码：</label>
                                            <div class="col-sm-8">
                                                <label for="m_wechat_code">
                                                    <img id="wechat_code" src="{$Config.wechat_code}" onerror="this.src='/static/Admin/img/no_img.png'"  style="max-width:  80px">
                                                    <input type="hidden" name="wechat_code" value="{$Config.wechat_code}">
                                                    <input type="file" id="m_wechat_code" class="upload_pic" style="display: none;">
                                                </label>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">支付宝收款码：</label>
                                            <div class="col-sm-8">
                                                <label for="m_ali_code">
                                                    <img id="ali_code" src="{$Config.ali_code}" onerror="this.src='/static/Admin/img/no_img.png'"  style="max-width:  80px">
                                                    <input type="hidden" name="ali_code" value="{$Config.ali_code}">
                                                    <input type="file" id="m_ali_code" class="upload_pic" style="display: none;">
                                                </label>
                                            </div>
                                        </div>

                                    </section>
                                    <section class="hide">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">提现开关：</label>
                                            <div class="col-sm-8">
                                                <select id="withdraw_switch" name="withdraw_switch" class="form-control">
                                                    <option value="1" {if condition="$Config.withdraw_switch eq 1"}selected{/if}>开启</option>
                                                    <option value="0" {if condition="$Config.withdraw_switch eq 0"}selected{/if}>关闭</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">关闭提示：</label>
                                            <div class="col-sm-8">
                                                <input id="withdraw_prompt" name="withdraw_prompt" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.withdraw_prompt}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">手续比例：</label>
                                            <div class="col-sm-8">
                                                <input id="withdraw_fees" name="withdraw_fees" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.withdraw_fees}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">最低提现：</label>
                                            <div class="col-sm-8">
                                                <input id="withdraw_down" name="withdraw_down" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.withdraw_down}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">提现倍数：</label>
                                            <div class="col-sm-8">
                                                <input id="withdraw_multiple" name="withdraw_multiple" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.withdraw_multiple}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">最低转账：</label>
                                            <div class="col-sm-8">
                                                <input id="transfer_down" name="transfer_down" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.transfer_down}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">转账倍数：</label>
                                            <div class="col-sm-8">
                                                <input id="transfer_multiple" name="transfer_multiple" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.transfer_multiple}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">转账手续费比例：</label>
                                            <div class="col-sm-8">
                                                <input id="transfer_fees" name="transfer_fees" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.transfer_fees}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">充值比例：</label>
                                            <div class="col-sm-8">
                                                <input id="chong" name="chong" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.chong}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">签到奖励：</label>
                                            <div class="col-sm-8">
                                                <input id="qiandao" name="qiandao" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.qiandao}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">每天释放比例：</label>
                                            <div class="col-sm-8">
                                                <input id="shifang" name="shifang" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.shifang}">
                                            </div>
                                        </div>

                                        <!--<div class="form-group">-->
                                            <!--<label class="col-sm-3 control-label">奖金利息比率：</label>-->
                                            <!--<div class="col-sm-8">-->
                                                <!--<input id="parameter_1" name="parameter_1" type="text" class="form-control" required="" aria-required="true" value="{$Config.parameter_1}">-->
                                            <!--</div>-->
                                        <!--</div>-->
                                        <!--<div class="form-group">-->
                                            <!--<label class="col-sm-3 control-label">炁点利息比率：</label>-->
                                            <!--<div class="col-sm-8">-->
                                                <!--<input id="parameter_2" name="parameter_2" type="text" class="form-control" required="" aria-required="true" value="{$Config.parameter_2}">-->
                                            <!--</div>-->
                                        <!--</div>-->
                                        <!--<div class="form-group">-->
                                            <!--<label class="col-sm-3 control-label">炁点转换股权：</label>-->
                                            <!--<div class="col-sm-8">-->
                                                <!--<input id="parameter_3" name="parameter_3" type="text" class="form-control" required="" aria-required="true" value="{$Config.parameter_3}">-->
                                                <!--<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> ？炁点 = 1股权</span>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                    </section>

                                    <section class="hide">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">余额比例：</label>
                                            <div class="col-sm-8">
                                                <input id="yu" name="yu" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.yu}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">积分比例：</label>
                                            <div class="col-sm-8">
                                                <input id="ji" name="ji" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.ji}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">一星董事分红：</label>
                                            <div class="col-sm-8">
                                                <input id="yi" name="yi" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.yi}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">二星董事分红：</label>
                                            <div class="col-sm-8">
                                                <input id="er" name="er" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.er}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">三星董事分红：</label>
                                            <div class="col-sm-8">
                                                <input id="san" name="san" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.san}">
                                            </div>
                                        </div>
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">管理津贴比例：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p1" name="p1" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p1}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">团队复购比例：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p2" name="p2" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p2}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">平级奖励比例：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p3" name="p3" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p3}">-->
<!--                                            </div>-->
<!--                                        </div>-->

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">部门考核业绩：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p4" name="p4" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p4}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!-- <div class="form-group" style="color: red;">-->
<!--                                        <label class="col-sm-3 control-label">团队累计业绩：</label>-->

<!--</div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">1星合作店最低范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p31" name="p31" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p31}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">2星合作店最低范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p32" name="p32" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p32}">-->
<!--                                            </div>-->
<!--                                        </div>-->

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">3星合作店范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p33" name="p33" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p33}">-->
<!--                                          —-->
<!--                                                <input id="p34" name="p34" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p34}">-->
<!--                                            </div>-->
<!--                                        </div>-->

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">分公司范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p35" name="p35" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p35}">-->
<!--                                                —-->
<!--                                                <input id="p36" name="p36" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p36}">-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">办事处范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p37" name="p37" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p37}">-->
<!--                                                —-->
<!--                                                <input id="p38" name="p38" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p38}">-->
<!--                                            </div>-->
<!--                                        </div>-->

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-sm-3 control-label">市场总监范围：</label>-->
<!--                                            <div class="col-sm-8">-->
<!--                                                <input id="p39" name="p39" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p39}">-->
<!--                                                —-->
<!--                                                <input id="p40" name="p40" maxlength="255" type="text" class="form-control" required="" aria-required="true" value="{$Config.p40}">-->
<!--                                            </div>-->
<!--                                        </div>-->
                                    </section>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-3">
                                            <button class="btn btn-primary" type="submit">确认修改</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {include file="public/foot"}
    </div>
</div>

{include file="public/footer"}
<script>
    $(".nav_list li").on('click', function () {
        let n = $(".nav_list li").index(this)
        $(".nav_list li").removeClass('active')
        $(this).addClass('active')
        $(".detail section").addClass('hide')
        $(".detail section").eq(n).removeClass('hide')
    })
</script>
<style>
    .hide{
        display: none!important;
    }
    .nav_list{
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
    .nav_list li{
        width: 90px;
        line-height: 30px;
        cursor: pointer;
        background-color: #e8e8e8;
        text-align: center;
        list-style-type:none
    }
    .nav_list li.active{
        background-color: #222;
        color: #fff;
    }

</style>

<script>
    //ajax异步图片上传
    $('.upload_pic').change(function(){
        //图片对象
        let that = $(this);
        var formData = new FormData();
        formData.append("image", that[0].files[0]);

        // 上传设置
        $.ajax({
            // 规定把请求发送到那个URL
            url: "{:url('Goods/forUpload')}",
            type: "post",            // 请求方式
            dtaType: 'json',
            data: formData,//传值就传fd对象了
            processData:false,  //告诉jQuery不要处理数据
            contentType: false,  //告诉jQuery不要设置contentType
            // 请求成功时执行的回调函数
            success: function (data) {
                if(data.status == 1)
                {
                    that.prev().val(data.message);
                    that.siblings('img').attr('src',data.message);
                }
                else
                {
                    alert(data.message);
                }
            }
        });
    });

    $('form').submit(function (e) {
        e.preventDefault();
        $.ajax({
            type:"post",
            url:"{:url('System/SystemConfig')}",
            data:$("form").serialize(),
            dataType:"json",
            success:function(data){
                if(data.status == 1){
                    layer.msg(data.message,{icon: 6,time:1500},function () {
                        window.top.location.reload();
                    });
                }else{
                    layer.msg(data.message,{icon: 5,time:1500});
                }
            }
        })
    })
</script>

</body>

</html>